2025-06-22 21:56:44,664 ERROR: Exception on /api/like [POST] [in C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\flask\app.py:1454]
Traceback (most recent call last):
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\base.py", line 1771, in _execute_context
    self.dialect.do_execute(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        cursor, statement, parameters, context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'finance.likes' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\flask\app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\flask\app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
                                                ~^^^^^^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\flask\app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\flask\app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "D:\作业\研一下\软件系统开发与设计\期末\master1\bob\backend\app.py", line 375, in like_post
    like = Likes.query.filter_by(user_id=user_id, post_id=post_id).first()
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\orm\query.py", line 2762, in first
    return self.limit(1)._iter().first()
           ~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\orm\query.py", line 2846, in _iter
    result = self.session.execute(
        statement,
        params,
        execution_options={"_sa_orm_load_options": self.load_options},
    )
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\orm\session.py", line 1689, in execute
    result = conn._execute_20(statement, params or {}, execution_options)
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\base.py", line 1583, in _execute_20
    return meth(self, args_10style, kwargs_10style, execution_options)
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\sql\elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self, multiparams, params, execution_options
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\base.py", line 1452, in _execute_clauseelement
    ret = self._execute_context(
        dialect,
    ...<8 lines>...
        cache_hit=cache_hit,
    )
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\base.py", line 1814, in _execute_context
    self._handle_dbapi_exception(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        e, statement, parameters, cursor, context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\base.py", line 1995, in _handle_dbapi_exception
    util.raise_(
    ~~~~~~~~~~~^
        sqlalchemy_exception, with_traceback=exc_info[2], from_=e
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
    raise exception
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\base.py", line 1771, in _execute_context
    self.dialect.do_execute(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        cursor, statement, parameters, context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\sqlalchemy\engine\default.py", line 717, in do_execute
    cursor.execute(statement, parameters)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
    ~~~~~~~~~~^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
    ~~~~~~~~~~~^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "C:\Users\86156\AppData\Local\Programs\Python\Python313\Lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'finance.likes' doesn't exist")
[SQL: SELECT likes.id AS likes_id, likes.user_id AS likes_user_id, likes.post_id AS likes_post_id, likes.created_at AS likes_created_at 
FROM likes 
WHERE likes.user_id = %(user_id_1)s AND likes.post_id = %(post_id_1)s 
 LIMIT %(param_1)s]
[parameters: {'user_id_1': 1, 'post_id_1': 1, 'param_1': 1}]
(Background on this error at: https://sqlalche.me/e/14/f405)
